// 适配器：将 OldPrinter 转换为 Scanner 接口
public class ScannerAdapter implements Scanner {
    private OldPrinter oldPrinter;

    public ScannerAdapter(OldPrinter oldPrinter) {
        this.oldPrinter = oldPrinter;
    }

    @Override
    public void scan(String document) {
        oldPrinter.printDocument(document);  // 模拟扫描功能
    }
}
